gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\quadrat\pquad2d.m

    function []=pquad2d(A,B,C,plotargs,win,interp)
% PQUAD2D plots contour of quadratic function in 2D.
%  pquad2d(A,B,C,plotargs,win,interp)
%
% PQUAD2D plots quadratic function in 2D space which is 
%   defined as
%      x'*A*x + B'*x + C = 0,
%
%   where A is matrix [2x2], B is vector [2x1] and C is real [1x1].
%
%   The argument plotargs has the same meaning as in Matlab function plot.
%   The function domain can be restricted by argument 
%   win=[xmin xmax ymin ymax], default values are taken from current
%   axes. The quadratic function is interpolated by lines and their 
%   number can be controled by the argument interp. 
%   
% Input:
%   A [2x2], B [2x1], C [1x1] coefficients of quadratic function
%   plotargs [string]  see help plot.
%   win [1x4] function domain, i.e. win=[xmin xmax ymin ymax]
%   interp [1x1] number of lines used for interpolation.
%
% See also L2Q2D.
%  

% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 19.11.1999
% Modifications
% 26-June-2001, V.Franc, comments repared.
% 24. 6.00 V. Hlavac, comments polished.


if nargin < 4,
  plotargs = '';
end

if nargin < 5,
  win = axis;
end

if nargin < 6,
  [x1,y1,x2,y2]=quad2d(A,B,C,win);
else
  [x1,y1,x2,y2]=quad2d(A,B,C,win,interp);
end

hold on;

if length(x1) ~= 0,
  plot(x1,y1,plotargs);
end

if length(x2) ~= 0,
  plot(x2,y2,plotargs);
end